package com.ponhu.ea2.dto;

import com.ponhu.ea2.support.validation.annotions.ValidateEnumValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

@Data
@Accessors(chain = true)
@ApiModel(value = "字典项数据DTO")
public class DictItemDataDto implements Serializable {
    private static final long serialVersionUID = -4440991151810078950L;

    @NotEmpty(message = "字典表名不能为空")
    @ValidateEnumValue(strValues = {"GOTOWARE_TYPE", "INVENTORY_SOURCE"}, message = "字典表名必须为指定值")
    @ApiModelProperty(value = "字典表名(GOTOWARE_TYPE:入库方式;INVENTORY_SOURCE:货源)", required = true)
    private String dictName;

    @NotEmpty(message = "字典项值不能为空")
    @ApiModelProperty(value = "字典项值(如果值存在，则更新；否则插入新值)", required = true)
    private String value;

    @NotEmpty(message = "字典项值名称不能为空")
    @ApiModelProperty(value = "字典项值名称", required = true)
    private String valueName;

}
